<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Strict//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
		<meta http-equiv="pragma" content="no-cache">
		<meta http-equiv="cache-control" content="no-cache">
		<meta http-equiv="expires" content="0"><meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />   
        <title>Welcome to Design Zone......</title>
        <link rel="stylesheet" type="text/css" href="../../scripts/ext/resources/css/ext-all.css" />
        <link rel="stylesheet" type="text/css"
			href="../../scripts/ext/resources/css/file-upload.css" />
        <link rel="stylesheet" type="text/css" href="../../styles/dzbase.css" />
        <script type="text/javascript" src="../../scripts/ext/adapter/ext-base.js">
        </script>
        <script type="text/javascript" src="../../scripts/ext/ext-all.js">
        </script>
        <script type="text/javascript"
			src="../../scripts/form/FileUploadField.js"></script>
        <script type="text/javascript" src="../../scripts/grid/GroupSummary.js">
        </script>
		<script type="text/javascript" src="../../scripts/grid/RowExpander.js">
        </script>
        <script type="text/javascript" src="../../scripts/menu/EditableItem.js">
        </script>
        <script type="text/javascript" src="../../scripts/menu/RangeMenu.js">
        </script>
        <script type="text/javascript" src="../../scripts/grid/GridFilters.js">
        </script>
        <script type="text/javascript" src="../../scripts/grid/filter/Filter.js">
        </script>
        <script type="text/javascript" src="../../scripts/grid/filter/StringFilter.js">
        </script>
        <script type="text/javascript" src="../../scripts/grid/filter/ListFilter.js">
        </script>
        <script type="text/javascript" src="../../scripts/form/FileUploadField.js">
        </script>
        <script type="text/javascript" src="../../scripts/i18nMessage.js">
        </script>
        <script type="text/javascript" src="../../scripts/utils.js">
        </script>
        <script type="text/javascript" src="../../scripts/selectProductDZColor.js">
        </script>
        <script type="text/javascript" src="../../scripts/selectBiFactory.js">
        </script>
        <script type="text/javascript">
        	var piMessage = new i18nMessage('../../servlet/I18nMessageServlet?keyPrefix=ui.productidentification');
        	var orderMessage = new i18nMessage('../../servlet/I18nMessageServlet?keyPrefix=ui.order');
        	var dzColorMessage = new i18nMessage('../../servlet/I18nMessageServlet?keyPrefix=ui.dzcolor');
            var pantoneMessage = new i18nMessage('../../servlet/I18nMessageServlet?keyPrefix=ui.pantonecolor');
			var yarnMessage = new i18nMessage('../../servlet/I18nMessageServlet?keyPrefix=ui.yarn');
			var customerMessage = new i18nMessage('../../servlet/I18nMessageServlet?keyPrefix=ui.francecustomer');
			var fMessage = new i18nMessage('../../servlet/I18nMessageServlet?keyPrefix=ui.factory');
			var fcMessage = new i18nMessage('../../servlet/I18nMessageServlet?keyPrefix=ui.francecustomer');
            var message = new i18nMessage('../../servlet/I18nMessageServlet?keyPrefix=message');
			var colorMessage = new i18nMessage('../../servlet/I18nMessageServlet?keyPrefix=ui.pantonecolor');
			
			var ctYesnoXmlLoader = new xmlLoader('../../servlet/CodeTableServlet?name=CtYesno');
			
			var orderProductId = getPrarmeterValue(window.location, 'id');
            var startPage = getPrarmeterValue(window.location, 'startPage');
			
			var itemForm;
			var itemStore;
            var itemGrid;
            
            var validateWin;

            var productDZColorXMLReader = new Ext.data.XmlReader({
                record: 'item'
            }, [{
                name: 'id',
                mapping: 'id'
            },{
            	name: 'sequence',
            	mapping: 'sequence'
            },{
            	name: 'variant',
            	mapping: 'variant'
            },{
                name: 'dzColorId',
                mapping: 'dzColorId'
            },{
                name: 'dzColorCode',
                mapping: 'dzColorCode'
            },{
                name: 'yarnReference',
                mapping: 'yarnReference'
            },{
                name: 'ctYarnMeasure',
                mapping: 'ctYarnMeasure'
            },{
                name: 'yarnAccount',
                mapping: 'yarnAccount'
            },{
                name: 'ctYarnMaterial1',
                mapping: 'ctYarnMaterial1'
            },{
                name: 'ctYarnMaterial2',
                mapping: 'ctYarnMaterial2'
            },{
                name: 'ctYarnMaterial3',
                mapping: 'ctYarnMaterial3'
            },{
                name: 'ctYarnMaterial4',
                mapping: 'ctYarnMaterial41'
            },{
                name: 'ctYarnMaterial5',
                mapping: 'ctYarnMaterial5'
            },{
                name: 'customerColorCode',
                mapping: 'customerColorCode'
            },{
                name: 'percentage',
                mapping: 'percentage'
            },{
                name: 'loss',
                mapping: 'loss'
            },{
                name: 'actualWeight',
                mapping: 'actualWeight'
            },{
                name: 'factoryName',
                mapping: 'factoryName'
            },{
				name: 'photo3Name',
				mapping: 'photo3Name'
            }]);
			
			var orderProductXMLReader = new Ext.data.XmlReader({
	                record: 'item'
	            }, [{
                    name: 'id',
                    mapping: 'id'
                },{
                    name: 'piId',
                    mapping: 'piId'
                },{
                    name: 'piReference',
                    mapping: 'piReference'
                },{
                    name: 'ctSeasonNumber',
                    mapping: 'ctSeasonNumber'
                },{
                    name: 'sketch1Name',
                    mapping: 'sketch1Name'
                },{
                    name: 'sketch2Name',
                    mapping: 'sketch2Name'
                },{
                    name: 'sketch3Name',
                    mapping: 'sketch3Name'
                },{
                    name: 'piReference',
                    mapping: 'piReference'
                },{
                    name: 'customerName',
                    mapping: 'customerName'
                },{
                    name: 'customerDepartment',
                    mapping: 'customerDepartment'
                },{
                    name: 'createDate',
                    mapping: 'createDate'
                },{
                    name: 'style',
                    mapping: 'style'
                },{
                    name: 'departureDate',
                    mapping: 'departureDate'
                },{
                    name: 'orderNumber',
                    mapping: 'orderNumber'
                },{
                    name: 'mainComposition',
                    mapping: 'mainComposition'
                },{
                    name: 'ctStatureCode',
                    mapping: 'ctStatureCode'
                }]);

			var orderProductXmlLoader = new xmlLoader('../../servlet/OrderProductServlet?action=11&id=' + orderProductId);
			var orderProductRecord = orderProductXMLReader.readRecords(orderProductXmlLoader.getXml()).records[0];
			var itemTplMarkup = [
						'<table cellspacing="0" id="the-table" style="width: 100%;"><tbody>',
							'<tr><td style="background:#eeeeee; width: 15%;">',
							piMessage.get('ui.productidentification.seasonnumber'),
							'</td><td>{ctSeasonNumber}</td>',
							'<td style="background:#eeeeee;width: 15%;">',
							piMessage.get('ui.productidentification.chart'),
							'</td><td>{piReference}</td>',
							'<td style="background:#eeeeee;">',
							message.get('message.edit.customername'),
							'</td><td>{customerName}</td></tr>',
							
							'<tr><td style="background:#eeeeee; width: 15%;">',
							 message.get('message.edit.date')+ '(d/m/Y)',
							'</td><td>{createDate}</td>',
							'<td style="background:#eeeeee;width: 15%;">',
							piMessage.get('ui.productidentification.style'),
							'</td><td>{style}</td>',
							'<td style="background:#eeeeee;">',
							fcMessage.get('ui.francecustomer.department'),
							'</td><td>{customerDepartment}</td></tr>',

							'<tr><td style="background:#eeeeee; width: 15%;">',
							orderMessage.get('ui.order.departuredata')+ '(d/m/Y)',
							'</td><td>{departureDate}</td>',
							'<td style="background:#eeeeee;width: 15%;">',
							yarnMessage.get('ui.yarn.composition'),
							'</td><td>{mainComposition}</td>',
							'<td style="background:#eeeeee;">',
							piMessage.get('ui.productidentification.ordernumber'),
							'</td><td>{orderNumber}</td></tr>',
														
							'<tr><td style="background:#eeeeee;">',
							orderMessage.get('ui.measurespecification.photo'),
							'</td><td colspan="5"><img height="200" src="../../_temp/{sketch1Name}">&nbsp;&nbsp;&nbsp;&nbsp;<img height="200" src="../../_temp/{sketch2Name}"></td></tr>',
						'</tbody></table>'
			];
			
            var itemTpl = new Ext.Template(itemTplMarkup);
            var sizeNameArray = getMeasureSpecificationItemName(orderProductRecord.data.ctStatureCode);


            var selectProductDZColorCallback = function(id, variant){
				Ext.getCmp('productDZColorId').setValue(id);
				Ext.getCmp('variant').setValue(variant);
            }

            var calculate = function(){
				var size1 = Ext.getCmp('size1Quantity').getValue();
				size1 = (size1==''?0:parseInt(size1));
				var size2 = Ext.getCmp('size2Quantity').getValue();
				size2 = (size2==''?0:parseInt(size2))
				var size3 = Ext.getCmp('size3Quantity').getValue();
				size3 = (size3==''?0:parseInt(size3))
				var size4 = Ext.getCmp('size4Quantity').getValue();
				size4 = (size4==''?0:parseInt(size4))
				var size5 = Ext.getCmp('size5Quantity').getValue();
				size5 = (size5==''?0:parseInt(size5))
				var size6 = Ext.getCmp('size6Quantity').getValue();
				size6 = (size6==''?0:parseInt(size6))
				var size7 = Ext.getCmp('size7Quantity').getValue();
				size7 = (size7==''?0:parseInt(size7))
				var size8 = Ext.getCmp('size8Quantity').getValue();
				size8 = (size8==''?0:parseInt(size8))
				Ext.getCmp('total').setValue(size1 + size2 + size3 + size4 + size5 + size6 + size7 + size8);
            }
            
            var editCallback = function(){
					itemForm.getForm().load({
						url:'../../servlet/OrderProductItemServlet?action=3&id=' + editId, 
						waitMsg:Ext.LoadMask.prototype.msg, 
						success: function(form, action){
						},
						failure: function(o){
							messageTip.msg(message.get('message.tip'), message.get('message.load.unsuccessful'));
						}
					});
				}
            
            var deleteCallback = function(btn){
	                if (btn == 'yes') {
	                    Ext.Ajax.request({
	                        url: '../../servlet/OrderProductItemServlet?action=2&id=' + deleteId,
	                        success: function(o){
	                            if (o.responseText == 'success') {
	                                itemStore.reload();
	                                messageTip.msg(message.get('message.tip'), message.get('message.delete.successful'));
	                            }
	                            else {
	                                messageTip.msg(message.get('message.tip'), message.get('message.delete.unsuccessful'));
	                            }
	                        },
	                        failure: function(o){
	                            messageTip.msg(message.get('message.tip'), message.get('message.delete.failure'));
	                        },
	                        params: {
	                            foo: 'bar'
	                        }
	                    });
	                }
	            }
            
			Ext.onReady(function(){
				itemTpl.append('orderProduct', orderProductRecord.data);
				
				Ext.QuickTips.init();
                Ext.form.Field.prototype.msgTarget = 'side';

                itemStore = new Ext.data.Store({
                    url: '../../servlet/OrderProductItemServlet?action=5&id=' + orderProductRecord.data.id,
                    
                    reader: new Ext.data.XmlReader({
                        record: 'item',
                        id: 'id',
                        totalRecords: 'itemTotal'
                    }, [ 
                    'index','variant', 'reference', 'size1Quantity','size2Quantity','size3Quantity', 'size4Quantity',
                    'size5Quantity','size6Quantity','size7Quantity', 'size8Quantity','total','percentage','actureWeight', 
                    'id','scheduleDate','stockDate','biFactoryId','factoryNameCN','factoryNameEN','isStock',
					{
						name:'size1QuantityConsistent',
						type: 'int'
					},{
						name:'size1QuantityNotConsistent',
						type: 'int'
					},{
						name:'size2QuantityConsistent',
						type: 'int'
					},{
						name:'size2QuantityNotConsistent',
						type: 'int'
					},{
						name:'size3QuantityConsistent',
						type: 'int'
					},{
						name:'size3QuantityNotConsistent',
						type: 'int'
					},{
						name:'size4QuantityConsistent',
						type: 'int'
					},{
						name:'size4QuantityNotConsistent',
						type: 'int'
					},{
						name:'size5QuantityConsistent',
						type: 'int'
					},{
						name:'size5QuantityNotConsistent',
						type: 'int'
					},{
						name:'size6QuantityConsistent',
						type: 'int'
					},{
						name:'size6QuantityNotConsistent',
						type: 'int'
					},{
						name:'size7QuantityConsistent',
						type: 'int'
					},{
						name:'size7QuantityNotConsistent',
						type: 'int'
					},{
						name:'size8QuantityConsistent',
						type: 'int'
					},{
						name:'size8QuantityNotConsistent',
						type: 'int'
					}]),
                    
                    remoteSort: false
                });
                
                var expander = new Ext.grid.RowExpander({
			        tpl : new Ext.XTemplate(
					    '{[this.getDZColor(values.id, values.total)]}',
						'<br/><table cellspacing="0" id="the-table" style="width: 80%;margin-left: 100px;">',
							'<tr><td style="background:#eeeeee;">' + sizeNameArray[0] + '</td>',
							'<td style="background:#eeeeee;">' + sizeNameArray[1] + '</td>',
							'<td style="background:#eeeeee;">' + sizeNameArray[2] + '</td>',
							'<td style="background:#eeeeee;">' + sizeNameArray[3] + '</td>',
							'<td style="background:#eeeeee;">' + sizeNameArray[4] + '</td>',
							'<td style="background:#eeeeee;">' + sizeNameArray[5] + '</td>',
							'<td style="background:#eeeeee;">' + sizeNameArray[6] + '</td>',
							'<td style="background:#eeeeee;">' + sizeNameArray[7] + '</td></tr>',
							'<tr><td>{size1Quantity}</td><td>{size2Quantity}</td><td>{size3Quantity}</td><td>{size4Quantity}</td><td>{size5Quantity}</td><td>{size6Quantity}</td><td>{size7Quantity}</td><td>{size8Quantity}</td></tr>',
						'</table><br/>',{
							getDZColor:function(id, total){
								var variantXmlLoader = new xmlLoader('../../servlet/OrderProductItemServlet?action=20&id=' + id);
								var variantRecords = productDZColorXMLReader.readRecords(variantXmlLoader.getXml()).records;
								var html = '<br/><table cellspacing="0" id="the-table" style="width: 80%;margin-left: 100px;"><tr>';
								html += ('<td style="background:#eeeeee;">' + dzColorMessage.get('ui.dzcolor.customercolorcode') + '</td>');
								html += ('<td style="background:#eeeeee;">' + dzColorMessage.get('ui.dzcolor.code') + '</td>');
								html += ('<td style="background:#eeeeee;">' + yarnMessage.get('ui.yarn.reference') + '</td>');
								html += ('<td style="background:#eeeeee;">' + dzColorMessage.get('ui.dzcolor.percentage') + '(%)</td>');
								html += ('<td style="background:#eeeeee;">' + dzColorMessage.get('ui.dzcolor.actualweight') + '(Kg)</td>');
								html += ('<td style="background:#eeeeee;">' + dzColorMessage.get('ui.dzcolor.actualweight') + '&nbsp;/&nbsp;' + orderMessage.get('ui.order.color') + '(Kg)</td>');
								html += '</tr>';
								
								for(var i = 0; i < variantRecords.length; i ++){
									var record = variantRecords[i];
									html += '<tr>';
									html += ('<td>' + record.data.customerColorCode + '</td>');
									html += ('<td>' + record.data.dzColorCode + '</td>');
									html += ('<td>' + record.data.yarnReference + '</td>');
									html += ('<td style="text-align: right;">' + record.data.percentage + '</td>');
									html += ('<td style="text-align: right;">' + record.data.actualWeight + '</td>');
									html += ('<td style="text-align: right;">' + render3D((record.data.actualWeight * total)) + '</td>');
									html += '</tr>';
								}
								
								html += '</table>'
								
					         	return html;
					     	}
						}
			        )
			    });

                itemGrid = new Ext.grid.GridPanel({
                    title: orderMessage.get('ui.order.variantlist'),
                    store: itemStore,
					stripeRows: true,
					plugins: [expander],
                    height: 560,
                    columns: [expander, {
                        header: message.get('message.list.id'),
                        width: 20,
                        dataIndex: 'index'
                    }, {
                        header: orderMessage.get('ui.order.reference'),
                        dataIndex: 'reference',
                        sortable: true
                    }, {
                        header: dzColorMessage.get('ui.dzcolor.variant'),
                        dataIndex: 'variant',
                        sortable: true
                    }, {
                        header: message.get('message.list.total') + '&nbsp;/&nbsp;' + dzColorMessage.get('ui.dzcolor.variant'),
                        dataIndex: 'total',
                        align: 'right',
                        sortable: true
                    }, {
                        header: dzColorMessage.get('ui.dzcolor.percentage') + '(%)',
                        dataIndex: 'percentage',
                        align: 'right',
                        sortable: true,
                        renderer: function(value, p, record, rowIndex, colIndex, store){
                        	var totalWeight =  0;
                        	for(var i = 0; i < store.getCount(); i ++){
                            	totalWeight += parseFloat(store.getAt(i).data.actureWeight);
                        	}
							return render2D((record.data.actureWeight * 100)/totalWeight);
                    	}
                    }, {
                        header: dzColorMessage.get('ui.dzcolor.actualweight') + '&nbsp;/&nbsp;' + dzColorMessage.get('ui.dzcolor.variant') + '(Kg)',
                        dataIndex: 'actureWeight',
                        sortable: true,
                        align: 'right',
                        renderer: render3D
                    },{
                        header: message.get('message.action.validator'),
                        dataIndex: 'id',
                        width: 20,
                        renderer: renderValidate
                    }],
                    viewConfig: {
                        forceFit: true
                    },
                    loadMask: true,
                    renderTo: 'itemList'
                });
                
                itemStore.load();
                //itemStore.setDefaultSort('index', 'asc');
                
              function renderValidate(value, p, record){
            	  if(record.data.isStock == '01')
	              	  return String.format('<a href="javascript:openValidateWin({0}, \'{1}\', \'{2}\',\'{3}\', \'{4}\', \'{5}\',\'{6}\', \'{7}\', \'{8}\',\'{9}\', \'{10}\', \'{11}\',\'{12}\', \'{13}\', \'{14}\',\'{15}\', \'{16}\', \'{17}\', \'{18}\', \'{19}\', \'{20}\',\'{21}\', \'{22}\', \'{23}\',\'{24}\', \'{25}\', \'{26}\', \'{27}\', \'{28}\', \'{29}\',\'{30}\');"><img src="../../images/icons/product_in_progress_1.png" title="' + message.get('message.action.validator') + '" /></a>', 
	              	  			record.id, 
	              	  			record.data.scheduleDate,
	              	  			record.data.stockDate,
	              	  			record.data.biFactoryId,
	              	  			record.data.factoryNameCN,
	              	  			record.data.factoryNameEN,
	              	  			record.data.total,
	              	  			record.data.size1Quantity,
	              	  			record.data.size1QuantityConsistent,
	              	  			record.data.size1QuantityNotConsistent,
	              	  			record.data.size2Quantity,
		              	  		record.data.size2QuantityConsistent,
	              	  			record.data.size2QuantityNotConsistent,
	              	  			record.data.size3Quantity,
		              	  		record.data.size3QuantityConsistent,
		          	  			record.data.size3QuantityNotConsistent,
		          	  			record.data.size4Quantity,
			          	  		record.data.size4QuantityConsistent,
			      	  			record.data.size4QuantityNotConsistent,
			      	  			record.data.size5Quantity,
				      	  		record.data.size5QuantityConsistent,
				  	  			record.data.size5QuantityNotConsistent,
				  	  			record.data.size6Quantity,
	  	  						record.data.size6QuantityConsistent,
					  			record.data.size6QuantityNotConsistent,
					  			record.data.size7Quantity,
					  			record.data.size7QuantityConsistent,
				  	  			record.data.size7QuantityNotConsistent,
				  	  			record.data.size8Quantity,
				  	  			record.data.size8QuantityConsistent,
					  			record.data.size8QuantityNotConsistent);
            	  else
            		  return String.format('<a href="javascript:openValidateWin({0}, \'{1}\', \'{2}\',\'{3}\', \'{4}\', \'{5}\',\'{6}\', \'{7}\', \'{8}\',\'{9}\', \'{10}\', \'{11}\',\'{12}\', \'{13}\', \'{14}\',\'{15}\', \'{16}\', \'{17}\', \'{18}\', \'{19}\', \'{20}\',\'{21}\', \'{22}\', \'{23}\',\'{24}\', \'{25}\', \'{26}\', \'{27}\', \'{28}\', \'{29}\',\'{30}\');"><img src="../../images/icons/product_in_progress_2.png" title="' + message.get('message.action.validator') + '" /></a>', 
            				  record.id, 
	              	  			record.data.scheduleDate,
	              	  			record.data.stockDate,
	              	  			record.data.biFactoryId,
	              	  			record.data.factoryNameCN,
	              	  			record.data.factoryNameEN,
	              	  			record.data.total,
	              	  			record.data.size1Quantity,
	              	  			record.data.size1QuantityConsistent,
	              	  			record.data.size1QuantityNotConsistent,
	              	  			record.data.size2Quantity,
		              	  		record.data.size2QuantityConsistent,
	              	  			record.data.size2QuantityNotConsistent,
	              	  			record.data.size3Quantity,
		              	  		record.data.size3QuantityConsistent,
		          	  			record.data.size3QuantityNotConsistent,
		          	  			record.data.size4Quantity,
			          	  		record.data.size4QuantityConsistent,
			      	  			record.data.size4QuantityNotConsistent,
			      	  			record.data.size5Quantity,
				      	  		record.data.size5QuantityConsistent,
				  	  			record.data.size5QuantityNotConsistent,
				  	  			record.data.size6Quantity,
	  	  						record.data.size6QuantityConsistent,
					  			record.data.size6QuantityNotConsistent,
					  			record.data.size7Quantity,
					  			record.data.size7QuantityConsistent,
				  	  			record.data.size7QuantityNotConsistent,
				  	  			record.data.size8Quantity,
				  	  			record.data.size8QuantityConsistent,
					  			record.data.size8QuantityNotConsistent);
                }
			});
			
			var validateForm = new Ext.FormPanel({
                labelAlign: 'left',
                url: '../../servlet/OrderProductItemServlet?action=40',
                frame: true,
                bodyStyle: 'padding:5px 5px 5px 5px;margin-top: 2px;',
                width: '100%',
                labelWidth: 105,
                //reader: piYarnXMLReader,
				  collapsible: true,
                items: [{
                    id: 'plId',
                    name: 'id',
                    xtype: 'hidden'
                }, {
                    id: 'biFactoryId',
                    name: 'biFactoryId',
                    xtype: 'hidden'
                }, {
                    layout: 'column',
                    items: [{
                        columnWidth: .5,
                        layout: 'form',
                        items: [{
                            id: 'scheduleDate',
                            name: 'scheduleDate',
                            xtype: 'datefield',
                            fieldLabel: piMessage.get('ui.productidentification.scheduledate')+'(d/m/y)',
                            anchor: '86%',
							  width: '90%',
                            allowBlank: true
                        },{
								id: 'stockDate',
	                            name: 'stockDate',
	                            fieldLabel: piMessage.get('ui.productidentification.instockdate')+'(d/m/y)',
	                            xtype: 'datefield',
	                            anchor: '86%',
								width: '90%',
	                            allowBlank: true
	                        },{
								id: 'factoryNameCN',
	                              name: 'factoryNameCN',
	                              fieldLabel: piMessage.get('ui.productidentification.stockplace'),
	                              emptyText: message.get('message.combo.pleaseselect'),
	                              xtype: 'textfield',
									readOnly: true,
	                              anchor: '86%',
									width: '90%',
	                              maxLength: 128,
	                              listeners: {
	                                  'render': {
	                                      fn: function(){
	                                          Ext.getCmp('factoryNameCN').getEl().on('click', function(){
	                                              selectFactory(selectFactoryCallback, "'09'");
	                                          }, this);
	                                      },
	                                      scope: this
	                                  }
	                              }
	                              
	                        }, {
	                            id: 'factoryNameEN',
	                            name: 'factoryNameEN',
	                            fieldLabel: '',
	                            labelSeparator:'',
	                            xtype: 'textfield',
	                            anchor: '86%',
	                            allowBlank: true,
	                            readOnly: true,
	                            maxLength: 128
	                        }]
                    }, {
                        columnWidth: .5,
                        layout: 'form',
                        items: [{
								id: 'quantity',
	                            name: 'quantity',
	                            fieldLabel: message.get('message.edit.quantity'),
	                            xtype: 'numberfield',
	                            anchor: '86%',
								width: '90%',
								readOnly: true,
	                            allowBlank: true
	                        },{
								  id: 'quantityConsistent',
	                              name: 'quantityConsistent',
	                              fieldLabel: piMessage.get('ui.productidentification.cquantity'),
	                              xtype: 'numberfield',
	                              //maxValue: Ext.getCmp('quantity').getValue(),
	                              anchor: '86%',
								  width: '90%',
	                              allowBlank: true,
	                              readOnly: true,listeners: {
	                                  'render': {
	                                      fn: function(){
	                                          Ext.getCmp('quantityConsistent').getEl().on('click', function(){
	                                          	Ext.getCmp('quantityConsistent').setValue(Ext.getCmp('size1QuantityConsistent').getValue() +
	                                          			Ext.getCmp('size2QuantityConsistent').getValue() +
	                                          			Ext.getCmp('size3QuantityConsistent').getValue() +
	                                          			Ext.getCmp('size4QuantityConsistent').getValue() +
	                                          			Ext.getCmp('size5QuantityConsistent').getValue() +
	                                          			Ext.getCmp('size6QuantityConsistent').getValue() +
	                                          			Ext.getCmp('size7QuantityConsistent').getValue() +
	                                          			Ext.getCmp('size8QuantityConsistent').getValue());
	                                          }, this);
	                                      },
	                                      scope: this
	                                  }
	                            }
	                          },{
								  id: 'quantityNotConsistent',
	                              name: 'quantityNotConsistent',
	                              fieldLabel: piMessage.get('ui.productidentification.cnquantity'),
	                              xtype: 'numberfield',
	                              //maxValue: Ext.getCmp('quantity').getValue(),
	                              anchor: '86%',
								  width: '90%',
	                              allowBlank: true,
	                              readOnly: true,
	                              listeners: {
	                                  'render': {
	                                      fn: function(){
	                                          Ext.getCmp('quantityNotConsistent').getEl().on('click', function(){
	                                          	Ext.getCmp('quantityNotConsistent').setValue(Ext.getCmp('size1QuantityNotConsistent').getValue() +
	                                          			Ext.getCmp('size2QuantityNotConsistent').getValue() +
	                                          			Ext.getCmp('size3QuantityNotConsistent').getValue() +
	                                          			Ext.getCmp('size4QuantityNotConsistent').getValue() +
	                                          			Ext.getCmp('size5QuantityNotConsistent').getValue() +
	                                          			Ext.getCmp('size6QuantityNotConsistent').getValue() +
	                                          			Ext.getCmp('size7QuantityNotConsistent').getValue() +
	                                          			Ext.getCmp('size8QuantityNotConsistent').getValue());
	                                          }, this);
	                                      },
	                                      scope: this
	                                  }
	                            }
	                          }]
                    }]
                },{
                    layout: 'column',
                    items: [{
                        columnWidth: .33,
                        layout: 'form',
                        items: [{
                            id: 'size1Quantity1',
                            name: 'size1Quantity1',
                            xtype: 'numberfield',
                            fieldLabel: sizeNameArray[0] + message.get('message.edit.quantity'),
                            anchor: '86%',
							width: '90%',
                            allowBlank: true,
                            readOnly: true
                        },{
                            id: 'size2Quantity1',
                            name: 'size2Quantity1',
                            xtype: 'numberfield',
                            fieldLabel: sizeNameArray[1] + message.get('message.edit.quantity'),
                            anchor: '86%',
							width: '90%',
                            allowBlank: true,
                            readOnly: true
                        },{
                            id: 'size3Quantity1',
                            name: 'size3Quantity1',
                            xtype: 'numberfield',
                            fieldLabel: sizeNameArray[2] + message.get('message.edit.quantity'),
                            anchor: '86%',
							width: '90%',
                            allowBlank: true,
                            readOnly: true
                        },{
                            id: 'size4Quantity1',
                            name: 'size4Quantity1',
                            xtype: 'numberfield',
                            fieldLabel: sizeNameArray[3] + message.get('message.edit.quantity'),
                            anchor: '86%',
							width: '90%',
                            allowBlank: true,
                            readOnly: true
                        },{
                            id: 'size5Quantity1',
                            name: 'size5Quantity1',
                            xtype: 'numberfield',
                            fieldLabel: sizeNameArray[4] + message.get('message.edit.quantity'),
                            anchor: '86%',
							width: '90%',
                            allowBlank: true,
                            readOnly: true
                        },{
                            id: 'size6Quantity1',
                            name: 'size6Quantity1',
                            xtype: 'numberfield',
                            fieldLabel: sizeNameArray[5] + message.get('message.edit.quantity'),
                            anchor: '86%',
							width: '90%',
                            allowBlank: true,
                            readOnly: true
                        },{
                            id: 'size7Quantity1',
                            name: 'size7Quantity1',
                            xtype: 'numberfield',
                            fieldLabel: sizeNameArray[6] + message.get('message.edit.quantity'),
                            anchor: '86%',
							width: '90%',
                            allowBlank: true,
                            readOnly: true
                        },{
                            id: 'size8Quantity1',
                            name: 'size8Quantity1',
                            xtype: 'numberfield',
                            fieldLabel: sizeNameArray[7] + message.get('message.edit.quantity'),
                            anchor: '86%',
							width: '90%',
                            allowBlank: true,
                            readOnly: true
                        }]
                    }, {
                        columnWidth: .33,
                        layout: 'form',
                        items: [{
							  id: 'size1QuantityConsistent',
                              name: 'size1QuantityConsistent',
                              fieldLabel: sizeNameArray[0] + piMessage.get('ui.productidentification.cquantity'),
                              xtype: 'numberfield',
                              //maxValue: Ext.getCmp('quantity').getValue(),
                              anchor: '86%',
							  width: '90%',
							  value: 0,
                              allowBlank: true,
                              readOnly: true,
                              listeners: {
                                  'render': {
                                      fn: function(){
                                          Ext.getCmp('size1QuantityConsistent').getEl().on('click', function(){
                                          	if((Ext.getCmp('size1Quantity1').getValue()-Ext.getCmp('size1QuantityConsistent').getValue()) < 0){
                                          		Ext.getCmp('size1QuantityConsistent').setValue(0);
                                          	}
                                          	Ext.getCmp('size1QuantityNotConsistent').setValue(Ext.getCmp('size1Quantity1').getValue()-Ext.getCmp('size1QuantityConsistent').getValue());
                                          }, this);
                                      },
                                      scope: this
                                  }
                            }
                          },{
							  id: 'size2QuantityConsistent',
                              name: 'size2QuantityConsistent',
                              fieldLabel: sizeNameArray[1] + piMessage.get('ui.productidentification.cquantity'),
                              xtype: 'numberfield',
                              //maxValue: Ext.getCmp('quantity').getValue(),
                              anchor: '86%',
							  width: '90%',
                              allowBlank: true,
                              value:0,
                              listeners: {
                                    'render': {
                                        fn: function(){
                                            Ext.getCmp('size2QuantityConsistent').getEl().on('click', function(){
                                            	if((Ext.getCmp('size2Quantity1').getValue()-Ext.getCmp('size2QuantityConsistent').getValue()) < 0){
                                            		Ext.getCmp('size2QuantityConsistent').setValue(0);
                                            	}
                                            	Ext.getCmp('size2QuantityNotConsistent').setValue(Ext.getCmp('size2Quantity1').getValue()-Ext.getCmp('size2QuantityConsistent').getValue());
                                            }, this);
                                        },
                                        scope: this
                                    }
                              }
                          },{
							  id: 'size3QuantityConsistent',
                              name: 'size3QuantityConsistent',
                              fieldLabel: sizeNameArray[2] + piMessage.get('ui.productidentification.cquantity'),
                              xtype: 'numberfield',
                              //maxValue: Ext.getCmp('quantity').getValue(),
                              anchor: '86%',
							  width: '90%',
                              allowBlank: true,
                              value:0,
                              listeners: {
                                  'render': {
                                      fn: function(){
                                          Ext.getCmp('size3QuantityConsistent').getEl().on('click', function(){
                                          	if((Ext.getCmp('size3Quantity1').getValue()-Ext.getCmp('size3QuantityConsistent').getValue()) < 0){
                                          		Ext.getCmp('size3QuantityConsistent').setValue(0);
                                          	}
                                          	Ext.getCmp('size3QuantityNotConsistent').setValue(Ext.getCmp('size3Quantity1').getValue()-Ext.getCmp('size3QuantityConsistent').getValue());
                                          }, this);
                                      },
                                      scope: this
                                  }
                            }
                          },{
							  id: 'size4QuantityConsistent',
                              name: 'size4QuantityConsistent',
                              fieldLabel: sizeNameArray[3] + piMessage.get('ui.productidentification.cquantity'),
                              xtype: 'numberfield',
                              //maxValue: Ext.getCmp('quantity').getValue(),
                              anchor: '86%',
							  width: '90%',
                              allowBlank: true,
                              value:0,
                              listeners: {
                                  'render': {
                                      fn: function(){
                                          Ext.getCmp('size4QuantityConsistent').getEl().on('click', function(){
                                          	if((Ext.getCmp('size4Quantity1').getValue()-Ext.getCmp('size4QuantityConsistent').getValue()) < 0){
                                          		Ext.getCmp('size4QuantityConsistent').setValue(0);
                                          	}
                                          	Ext.getCmp('size4QuantityNotConsistent').setValue(Ext.getCmp('size4Quantity1').getValue()-Ext.getCmp('size4QuantityConsistent').getValue());
                                          }, this);
                                      },
                                      scope: this
                                  }
                            }
                          },{
							  id: 'size5QuantityConsistent',
                              name: 'size5QuantityConsistent',
                              fieldLabel: sizeNameArray[4] + piMessage.get('ui.productidentification.cquantity'),
                              xtype: 'numberfield',
                              //maxValue: Ext.getCmp('quantity').getValue(),
                              anchor: '86%',
							  width: '90%',
							  value:0,
                              allowBlank: true,
                              listeners: {
                                  'render': {
                                      fn: function(){
                                          Ext.getCmp('size5QuantityConsistent').getEl().on('click', function(){
                                          	if((Ext.getCmp('size5Quantity1').getValue()-Ext.getCmp('size5QuantityConsistent').getValue()) < 0){
                                          		Ext.getCmp('size5QuantityConsistent').setValue(0);
                                          	}
                                          	Ext.getCmp('size5QuantityNotConsistent').setValue(Ext.getCmp('size5Quantity1').getValue()-Ext.getCmp('size5QuantityConsistent').getValue());
                                          }, this);
                                      },
                                      scope: this
                                  }
                            }
                          },{
							  id: 'size6QuantityConsistent',
                              name: 'size6QuantityConsistent',
                              fieldLabel: sizeNameArray[5] + piMessage.get('ui.productidentification.cquantity'),
                              xtype: 'numberfield',
                              //maxValue: Ext.getCmp('quantity').getValue(),
                              anchor: '86%',
							  width: '90%',
							  value:0,
                              allowBlank: true,
                              listeners: {
                                  'render': {
                                      fn: function(){
                                          Ext.getCmp('size6QuantityConsistent').getEl().on('click', function(){
                                          	if((Ext.getCmp('size6Quantity1').getValue()-Ext.getCmp('size6QuantityConsistent').getValue()) < 0){
                                          		Ext.getCmp('size6QuantityConsistent').setValue(0);
                                          	}
                                          	Ext.getCmp('size6QuantityNotConsistent').setValue(Ext.getCmp('size6Quantity1').getValue()-Ext.getCmp('size6QuantityConsistent').getValue());
                                          }, this);
                                      },
                                      scope: this
                                  }
                             }
                          },{
							  id: 'size7QuantityConsistent',
                              name: 'size7QuantityConsistent',
                              fieldLabel: sizeNameArray[6] + piMessage.get('ui.productidentification.cquantity'),
                              xtype: 'numberfield',
                              //maxValue: Ext.getCmp('quantity').getValue(),
                              anchor: '86%',
							  width: '90%',
                              allowBlank: true,
                              value:0,                              
                              listeners: {
                                  'render': {
                                      fn: function(){
                                          Ext.getCmp('size7QuantityConsistent').getEl().on('click', function(){
                                          	if((Ext.getCmp('size7Quantity1').getValue()-Ext.getCmp('size7QuantityConsistent').getValue()) < 0){
                                          		Ext.getCmp('size7QuantityConsistent').setValue(0);
                                          	}
                                          	Ext.getCmp('size7QuantityNotConsistent').setValue(Ext.getCmp('size7Quantity1').getValue()-Ext.getCmp('size7QuantityConsistent').getValue());
                                          }, this);
                                      },
                                      scope: this
                                  }
                             }
                          },{
							  id: 'size8QuantityConsistent',
                              name: 'size8QuantityConsistent',
                              fieldLabel: sizeNameArray[7] + piMessage.get('ui.productidentification.cquantity'),
                              xtype: 'numberfield',
                              //maxValue: Ext.getCmp('quantity').getValue(),
                              anchor: '86%',
							  width: '90%',
							  value:0,
                              allowBlank: true,
                              listeners: {
                                  'render': {
                                      fn: function(){
                                          Ext.getCmp('size6QuantityConsistent').getEl().on('click', function(){
                                          	if((Ext.getCmp('size6Quantity1').getValue()-Ext.getCmp('size6QuantityConsistent').getValue()) < 0){
                                          		Ext.getCmp('size6QuantityConsistent').setValue(0);
                                          	}
                                          	Ext.getCmp('size6QuantityNotConsistent').setValue(Ext.getCmp('size6Quantity1').getValue()-Ext.getCmp('size6QuantityConsistent').getValue());
                                          }, this);
                                      },
                                      scope: this
                                  }
                             }
                          }]
                    }, {
                        columnWidth: .33,
                        layout: 'form',
                        items: [{
							  id: 'size1QuantityNotConsistent',
                              name: 'size1QuantityNotConsistent',
                              fieldLabel: sizeNameArray[0] + piMessage.get('ui.productidentification.cnquantity'),
                              xtype: 'numberfield',
                              //maxValue: Ext.getCmp('quantity').getValue(),
                              anchor: '86%',
							  width: '90%',
							  value:0,
                              allowBlank: true,
                              listeners: {
                                  'render': {
                                      fn: function(){
                                          Ext.getCmp('size1QuantityNotConsistent').getEl().on('click', function(){
                                          	if((Ext.getCmp('size1Quantity1').getValue()-Ext.getCmp('size1QuantityConsistent').getValue()) < 0){
                                          		Ext.getCmp('size1QuantityConsistent').setValue(0);
                                          	}
                                          	Ext.getCmp('size1QuantityNotConsistent').setValue(Ext.getCmp('size1Quantity1').getValue()-Ext.getCmp('size1QuantityConsistent').getValue());
                                          }, this);
                                      },
                                      scope: this
                                  }
                            }
                          },{
							  id: 'size2QuantityNotConsistent',
                              name: 'size2QuantityNotConsistent',
                              fieldLabel: sizeNameArray[1] + piMessage.get('ui.productidentification.cnquantity'),
                              xtype: 'numberfield',
                              value:0,
                              //maxValue: Ext.getCmp('quantity').getValue(),
                              anchor: '86%',
							  width: '90%',
                              allowBlank: true,
                              listeners: {
                                  'render': {
                                      fn: function(){
                                          Ext.getCmp('size2QuantityNotConsistent').getEl().on('click', function(){
                                          	if((Ext.getCmp('size2Quantity1').getValue()-Ext.getCmp('size2QuantityConsistent').getValue()) < 0){
                                          		Ext.getCmp('size2QuantityConsistent').setValue(0);
                                          	}
                                          	Ext.getCmp('size2QuantityNotConsistent').setValue(Ext.getCmp('size2Quantity1').getValue()-Ext.getCmp('size2QuantityConsistent').getValue());
                                          }, this);
                                      },
                                      scope: this
                                  }
                            }
                          },{
							  id: 'size3QuantityNotConsistent',
                              name: 'size3QuantityNotConsistent',
                              fieldLabel: sizeNameArray[2] + piMessage.get('ui.productidentification.cnquantity'),
                              xtype: 'numberfield',
                              value:0,
                              //maxValue: Ext.getCmp('quantity').getValue(),
                              anchor: '86%',
							  width: '90%',
                              allowBlank: true,
                              listeners: {
                                  'render': {
                                      fn: function(){
                                          Ext.getCmp('size3QuantityNotConsistent').getEl().on('click', function(){
                                          	if((Ext.getCmp('size3Quantity1').getValue()-Ext.getCmp('size3QuantityConsistent').getValue()) < 0){
                                          		Ext.getCmp('size3QuantityConsistent').setValue(0);
                                          	}
                                          	Ext.getCmp('size3QuantityNotConsistent').setValue(Ext.getCmp('size3Quantity1').getValue()-Ext.getCmp('size3QuantityConsistent').getValue());
                                          }, this);
                                      },
                                      scope: this
                                  }
                            }
                          },{
							  id: 'size4QuantityNotConsistent',
                              name: 'size4QuantityNotConsistent',
                              fieldLabel: sizeNameArray[3] + piMessage.get('ui.productidentification.cnquantity'),
                              xtype: 'numberfield',
                              value:0,
                              //maxValue: Ext.getCmp('quantity').getValue(),
                              anchor: '86%',
							  width: '90%',
                              allowBlank: true,
                              listeners: {
                                  'render': {
                                      fn: function(){
                                          Ext.getCmp('size4QuantityNotConsistent').getEl().on('click', function(){
                                          	if((Ext.getCmp('size4Quantity1').getValue()-Ext.getCmp('size4QuantityConsistent').getValue()) < 0){
                                          		Ext.getCmp('size4QuantityConsistent').setValue(0);
                                          	}
                                          	Ext.getCmp('size4QuantityNotConsistent').setValue(Ext.getCmp('size4Quantity1').getValue()-Ext.getCmp('size4QuantityConsistent').getValue());
                                          }, this);
                                      },
                                      scope: this
                                  }
                            }
                          },{
							  id: 'size5QuantityNotConsistent',
                              name: 'size5QuantityNotConsistent',
                              fieldLabel: sizeNameArray[4] + piMessage.get('ui.productidentification.cnquantity'),
                              xtype: 'numberfield',
                              //maxValue: Ext.getCmp('quantity').getValue(),
                              anchor: '86%',
							  width: '90%',
							  value:0,
                              allowBlank: true,
                              listeners: {
                                  'render': {
                                      fn: function(){
                                          Ext.getCmp('size5QuantityNotConsistent').getEl().on('click', function(){
                                          	if((Ext.getCmp('size5Quantity1').getValue()-Ext.getCmp('size5QuantityConsistent').getValue()) < 0){
                                          		Ext.getCmp('size5QuantityConsistent').setValue(0);
                                          	}
                                          	Ext.getCmp('size5QuantityNotConsistent').setValue(Ext.getCmp('size5Quantity1').getValue()-Ext.getCmp('size5QuantityConsistent').getValue());
                                          }, this);
                                      },
                                      scope: this
                                  }
                            }
                          },{
							  id: 'size6QuantityNotConsistent',
                              name: 'size6QuantityNotConsistent',
                              fieldLabel: sizeNameArray[5] + piMessage.get('ui.productidentification.cnquantity'),
                              xtype: 'numberfield',
                              //maxValue: Ext.getCmp('quantity').getValue(),
                              anchor: '86%',
							  width: '90%',
							  value:0,
                              allowBlank: true,
                              listeners: {
                                  'render': {
                                      fn: function(){
                                          Ext.getCmp('size6QuantityNotConsistent').getEl().on('click', function(){
                                          	if((Ext.getCmp('size6Quantity1').getValue()-Ext.getCmp('size6QuantityConsistent').getValue()) < 0){
                                          		Ext.getCmp('size6QuantityConsistent').setValue(0);
                                          	}
                                          	Ext.getCmp('size6QuantityNotConsistent').setValue(Ext.getCmp('size6Quantity1').getValue()-Ext.getCmp('size6QuantityConsistent').getValue());
                                          }, this);
                                      },
                                      scope: this
                                  }
                            }
                          },{
							  id: 'size7QuantityNotConsistent',
                              name: 'size7QuantityNotConsistent',
                              fieldLabel: sizeNameArray[6] + piMessage.get('ui.productidentification.cnquantity'),
                              xtype: 'numberfield',
                              //maxValue: Ext.getCmp('quantity').getValue(),
                              anchor: '86%',
							  width: '90%',
							  value:0,
                              allowBlank: true,
                              listeners: {
                                  'render': {
                                      fn: function(){
                                          Ext.getCmp('size7QuantityNotConsistent').getEl().on('click', function(){
                                          	if((Ext.getCmp('size7Quantity1').getValue()-Ext.getCmp('size7QuantityConsistent').getValue()) < 0){
                                          		Ext.getCmp('size7QuantityConsistent').setValue(0);
                                          	}
                                          	Ext.getCmp('size7QuantityNotConsistent').setValue(Ext.getCmp('size7Quantity1').getValue()-Ext.getCmp('size7QuantityConsistent').getValue());
                                          }, this);
                                      },
                                      scope: this
                                  }
                              }
                          },{
							  id: 'size8QuantityNotConsistent',
                              name: 'size8QuantityNotConsistent',
                              fieldLabel: sizeNameArray[7] + piMessage.get('ui.productidentification.cnquantity'),
                              xtype: 'numberfield',
                              //maxValue: Ext.getCmp('quantity').getValue(),
                              anchor: '86%',
							  width: '90%',
							  value:0,
                              allowBlank: true,
                              listeners: {
                                  'render': {
                                      fn: function(){
                                          Ext.getCmp('size8QuantityNotConsistent').getEl().on('click', function(){
                                          	if((Ext.getCmp('size8Quantity1').getValue()-Ext.getCmp('size8QuantityConsistent').getValue()) < 0){
                                          		Ext.getCmp('size8QuantityConsistent').setValue(0);
                                          	}
                                          	Ext.getCmp('size8QuantityNotConsistent').setValue(Ext.getCmp('size8Quantity1').getValue()-Ext.getCmp('size8QuantityConsistent').getValue());
                                          }, this);
                                      },
                                      scope: this
                                  }
                              }
                          }]
                    }]
                }],
                
                buttons: [{
                    text: message.get('message.edit.save'),
                    handler: function(){
                  	  if(Ext.getCmp('quantityNotConsistent').getValue() > Ext.getCmp('quantity').getValue()){
                  		  messageTip.msg(message.get('message.tip'), message.get('message.edit.error'));
                  		  return;
                  	  }
                  	  if(Ext.getCmp('quantityConsistent').getValue() > Ext.getCmp('quantity').getValue()){
                  		  messageTip.msg(message.get('message.tip'), message.get('message.edit.error'));
                  		  return;
                  	  }
                        if (validateForm.getForm().isValid()) {
                            //document.getElementsByName('yarn')[0].value = yarnCombo.getValue();
                            
                            validateForm.getForm().submit({
                                method: 'post',
                                success: function(form, action){
                                    messageTip.msg(message.get('message.tip'), message.get('message.edit.successful'));
                                    validateForm.getForm().reset();
                                    itemStore.load();
                                    validateWin.hide();
                                },
                                failure: function(form, action){
                                    messageTip.msg(message.get('message.tip'), message.get('message.edit.unsuccessful'));
                                }
                            });
                        }
                    }
                }, {
                    text: message.get('message.edit.reset'),
                    handler: function(){
                  	  Ext.getCmp('scheduleDate').setValue("");
                  	  Ext.getCmp('stockDate').setValue("");
                  	  Ext.getCmp('biFactoryId').setValue("");
                  	  Ext.getCmp('factoryNameCN').setValue("");
                  	  Ext.getCmp('factoryNameEN').setValue("");
                  	  Ext.getCmp('quantity').setValue("");
                  	  Ext.getCmp('quantityConsistent').setValue("");
                  	  Ext.getCmp('quantityNotConsistent').setValue("");
                    }
                }, {
                    text: message.get('message.edit.cancel'),
                    handler: function(){
                  	  validateForm.getForm().reset();
                  	  validateWin.hide();
                    }
                }]
            });
			
		 	function openValidateWin(id, scheduleDate, stockDate,biFactoryId,factoryNameCN,factoryNameEN,total,
		 			size1Quantity1, size1QuantityConsistent,size1QuantityNotConsistent,
		 			size2Quantity1, size2QuantityConsistent,size2QuantityNotConsistent,
		 			size3Quantity1, size3QuantityConsistent,size3QuantityNotConsistent,
		 			size4Quantity1, size4QuantityConsistent,size4QuantityNotConsistent,
		 			size5Quantity1, size5QuantityConsistent,size5QuantityNotConsistent,
		 			size6Quantity1, size6QuantityConsistent,size6QuantityNotConsistent,
		 			size7Quantity1, size7QuantityConsistent,size7QuantityNotConsistent,
		 			size8Quantity1, size8QuantityConsistent,size8QuantityNotConsistent){
            	  if(!validateWin){
            		  validateWin = new Ext.Window({
                          title: message.get('message.action.validator'),
                          layout: 'fit',
                          width: 800,
                          height: 420,
                          closeAction: 'hide',
                          plain: true,
                          items: [validateForm]
                      });
            	  }
            	  Ext.getCmp('plId').setValue(id);
            	  Ext.getCmp('scheduleDate').setValue(scheduleDate);
            	  Ext.getCmp('stockDate').setValue(stockDate);
            	  Ext.getCmp('biFactoryId').setValue(biFactoryId);
            	  Ext.getCmp('factoryNameCN').setValue(factoryNameCN);
            	  Ext.getCmp('factoryNameEN').setValue(factoryNameEN);
            	  Ext.getCmp('quantity').setValue(total);
            	  Ext.getCmp('size1Quantity1').setValue(size1Quantity1);
            	  Ext.getCmp('size2Quantity1').setValue(size2Quantity1);
            	  Ext.getCmp('size3Quantity1').setValue(size3Quantity1);
            	  Ext.getCmp('size4Quantity1').setValue(size4Quantity1);
            	  Ext.getCmp('size5Quantity1').setValue(size5Quantity1);
            	  Ext.getCmp('size6Quantity1').setValue(size6Quantity1);
            	  Ext.getCmp('size7Quantity1').setValue(size7Quantity1);
            	  Ext.getCmp('size8Quantity1').setValue(size8Quantity1);
            	  //Ext.getCmp('quantityConsistent').setValue(quantityConsistent);
            	  //Ext.getCmp('quantityNotConsistent').setValue(quantityNotConsistent);
            	  validateWin.show(this);
              };
               
              var selectFactoryCallback = function(factoryId, factoryName){
                  document.getElementById('biFactoryId').value = factoryId;
                  document.getElementById('factoryNameCN').value = selectedFactory.nameCN;
                  document.getElementById('factoryNameEN').value = selectedFactory.nameEN;
              }
			
        
        </script>
    </head>
    <body>
       <div id="orderProduct">
				
		</div>
		<div id="itemList">
			
		</div>
    </body>
</html>
